package show.me.the.money.util.exp.standard;

import java.util.List;

import show.me.the.money.util.T;
import show.me.the.money.util.context.Context;
import show.me.the.money.util.exp.Expression;

@SuppressWarnings("unchecked")
public class DATETIME extends Expression {
	public Object run(List lsExp, Context ctx) {
		long l = 0;
		try {
			l = T.parseDateTime((String)lsExp.get(1)).getTime();
			return String.valueOf(l);
		} catch (Exception e) {
			logger.fatal("run JSONException:", e);
		}
		return l;
	}

	public String toString(List lsExp, Context ctx) {
		try {
			return "'" + (String)lsExp.get(1) + "'";
		} 
		catch (Exception e) {
			logger.fatal("run JSONException:", e);
		}
		return "";
	}

}
